<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/common.php';

$action_result = $_SESSION['action_result'];
$_SESSION['action_result'] = "";

page::printTop();
?>

<div style=height:5px></div>

<div id="gallery">
<?php
$items = troop::getAllItemTroop(50);
foreach ($items as $item)
{
	echo "<div class=item>";
	echo sprintf("<div id=item_%s class=item_label><input class=item_button type=button value='...' />"
		."<input type=hidden class=item_emotion value='%s' />"
		."</div>", $item['item_id'], $item['item_emotion']);
	echo sprintf("<img onerror='this.src=\"images/no_image_avail.jpg\"' src='%s' class=item_image />",
		$item['item_image_s']);
	echo "</div>\n";
}

$t = item::getOlderById($item['item_id']);
$older_item_id = intval($t['item_id']);

?>
<a style="color:#0b6cb7;font-size:40px;padding-top:60px;" href="/item/<?php echo $older_item_id;?>/">&nbsp;&nbsp;more...</a>
</div>

<span id="popup">
	<div id="popup_headline">
		<div id="popup_item_emotion" style="font-size:14.5px;"></div>
		<span id="popup_item_user"></span>
		<span id="popup_item_reply_info"></span>
	</div>

	<div id="popup_content">
		<div id="popup_reply_area">
			<input id="popup_reply" style="width:300px;" value='' />
			<input id="popup_i_yes" type=button value='喜欢！' />
			<input id="popup_i_no" type=button value='不喜欢' />
		</div>
		<div style=text-align:center><img id=popup_image src="items/no_image_avail.jpg" /></div>
	</div>
</span>

<?php
page::printTail();
